#ifndef _GLOBALVAR_H
#define _GLOBALVAR_H

#include <string>
using namespace std;
namespace GLOBALVAR
{
    template <typename T>
    struct container
    {
        static string sCurrentExeDir;
    };

    template <typename T>
    string container<T>::sCurrentExeDir;
}

class globalFunction;
using globalFunction_data = GLOBALVAR::container<globalFunction> ;

struct globalFunction
{
    static void setCurrentExeDir(const char *path)
    {
        globalFunction_data::sCurrentExeDir = path;
        int pos = globalFunction_data::sCurrentExeDir.find_last_of(string("\\"));
        globalFunction_data::sCurrentExeDir = globalFunction_data::sCurrentExeDir.substr(0, pos + 1);
    }
};

#endif